Recipients Property (Message Object) 

The Recipients property returns a single Recipient_SDVUS object or a Recipients1S0GWB8 collection object. Read/write.

Syntax

Set objRecipColl = objMessage.Recipients

Set objOneRecip = objMessage.Recipients(index)

objRecipColl

Object. A Recipients collection object.

objMessage

Object. The Message object.

objOneRecip

Object. A single Recipient object.

index

Long. Specifies the number of the recipient within the Recipients collection. Ranges from 1 to the value specified by the Recipients collection s Count property.

 

Data Type

Object

Example

The Recipients property itself is read-only, indicating that you cannot set the value of this property to indicate another collection. However, you can change individual Recipient objects within the collection, add Recipient objects to the collection, and remove Recipient objects from the collection.

This example copies each of the recipients from the original message objOneMsg to the copy objCopyMsg:

' from the sample function Util_CopyMessage

    For i = 1 To objOneMsg.Recipients.Count Step 1

        strRecipName = objOneMsg.Recipients.Item(i).Name

        If strRecipName <> "" Then

            Set objOneRecip = objCopyMsg.Recipients.Add

            If objOneRecip Is Nothing Then

                MsgBox "unable to create recipient in message copy"

                Exit Function

            End If

            objOneRecip.Name = strRecipName

        End If

    Next i